<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<a th:href="@{/toAdd(add)}">添加</a>



    <form action="/page" method="get">

        <input type="text" name="names" placeholder="输入姓名">
        <input type="submit" value="提交">


        <table>
            <tr>
                <td>id</td>
                <td>name</td>
                <td>sex</td>
                <td>age</td>
                <td>address</td>
                <td>
                    操作
                </td>
            </tr>
            <tr th:each="a:${students.records}">


                <td th:text="${a.getId()}"></td>
                <td th:text="${a.getName()}"></td>
                <td th:text="${a.getSex()}"></td>
                <td th:text="${a.getAge()}"></td>
                <td th:text="${a.getAddress()}"></td>
                <td>
                    <a th:href="@{/findById(id=${a.getId()})}">修改</a>
                    <a th:href="@{/del(id=${a.getId()})}">删除</a>
                </td>
            </tr>
        </table>
<!--        <div>-->
<!--            <a>-->
<!--                <b th:text="'共'+ ${currentPage.getPages()}+'页'"></b>-->
<!--            </a>-->
<!--            <a th:href="@{/page(currentPage=${currentPage.getFirstPage()})}">首页</a>-->
<!--            <a th:if="${currentPage.hasPreviousPage()} == true" th:href="@{/page(currentPage=${currentPage.getPrePage()})}">上一页</a>-->
<!--            <a th:href="@{'/page?currentPage=' +${i}}" th:each="i :${#numbers.sequence(currentPage.firstPage,currentPage.lastPage)}" th:class="${currentPage.getPageNumber() == i}?'page-item active' : 'page-item'"></a>-->
<!--            <a th:if="${currentPage.hasNextPage()} == true" th:href="@{/page(currentPage=${currentPage.getNextPage()})}">下一页</a>-->
<!--            <a th:href="@{/page(currentPage=${currentPage.getLastPage()})}">尾页</a>-->
<!--        </div>-->



<!--       // <text th:text="@{/page(current)}"></text>-->

        <a href="/page?current=1">首页</a>
        <a th:href="@{/page(current=${students.getCurrent()-1})}">上一页</a>
        <a th:href="@{/page(current=${students.getCurrent()+1})}">下一页</a>
        <a th:href="@{/page(current=${students.getPages()})}">尾页</a>
</form>
</body>
</html>